home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-08-25 | 11.0 KB | 391 lines | [TEXT/CWIE] |
- ========================================================================
- PowerPlant Core Classes Notes
- ========================================================================
-
- Version: PowerPlant 1.9.2
- Date: August 24, 1998
- ========================================================================
-
- This note describes changes from PowerPlant 1.9.1, which was a
- post-CW Pro 3 update. Read the release notes for PP 1.9.1 for
- information about the changes since CW Pro 3.
-
-
- ========================================================================
- Changes Required for Existing Projects
- ========================================================================
-
- * LCommander::AllowSwitchTarget() function removed. It's been renamed
- to AllowBeTarget() to go along with the new AllowDontBeTarget()
- function. AllowBeTarget() works almost the same as
- AllowSwitchTarget(), and you code should work the same if you
- just rename your overrides of AllowSwitchTarget() as
- AllowBeTarget().
-
- * Removed checks for color QuickDraw in UDesktop, UFloatingDesktop,
- LPrintout, and UScreenPort. Everything uses color ports now.
- Most other PP imaging classes assume that color Quickdraw
- is present, so those checks didn't do any good.
-
- However, if you modified PP to work on black & white sytems,
- you will need to put these checks back in yourself.
-
- * LClock class has major changes. Old version was a stub that did
- not really work. If you have LClock items in existing PPob
- resources, you may want to delete and recreate them as the
- clock flags field could have an invalid value.
-
- The definition within PowerPlant.r for LClock changed to
- reflect the new clock flags. You may need to modify
- Rez files that define LClock items.
-
- * LControlImp::DoKeyPress() now returns a control part code instead
- of a bool. Part code of 0 means the keypress wasn't handled,
- so client code should still work (since 0 means false).
- But you must change subclasses which override DoKeyPress.
-
-
- ========================================================================
- Source Code Changes
- ========================================================================
-
- LAMControlImp
- -------------
- * SetFontStyle()
- Declared ControlFontStyleRec& parameter as const
-
- * GetFontSytle()
- Declared as const
-
- * SetKeyboardFocusPart()
- New function which sets the focus within a multipart control
-
- * BeTarget()
- Don't call SetKeyboardFocus() if part is kControlFocusNoPart
-
- * DoKeyPress()
- Returns control part code instead of a bool
-
-
- LAMPopupButtonImp
- -----------------
- * Init()
- Set Menu ID to MENU_Unspecified before calling inherited Init()
- and restore it afterwards.
-
-
- LApplication
- ------------
- * Run()
- Call ForceTargetSwitch() instead of SwitchTarget();
-
- LAttachable
- -----------
- * GetAttachmentsList()
- New inline function which returns the list of Attachments
-
-
- LClock
- ------
- * Major rewrite of the entire class. Old version was just a stub
- and did not work.
-
- - Inherits from LPeriodical to support live clocks.
- - Supports the Tab key for moving focus among the individual
- fields within the clock
- - Broadcasts value message when user changes clock setting
-
- If you have LClock items in existing PPob resources, you
- may want to delete and re-create them. The clock flags
- field could have an invalid value. The "live" flag only
- applies if the "display only" flag is also set. Therefore,
- there is now a "live display only" flag and no "live" flag.
- The value of the flags should never be 2 ("live" without
- "display only").
-
-
- LCommander
- ----------
- * AllowBeTarget()
- * AllowDontBeTarget()
- New functions for controlling Target switching. Before changing
- the Target, SwitchTarget() calls AllowDontBeTarget() for the
- current Target, and AllowBeTarget() for the potential new
- Target.
-
- The default behavior is to pass the request up the chain
- of command. This allows Commanders to perform validation
- checks on themselves or their subcommanders. This mechanism
- is much more flexible than the old technique which called
- AllowTargetSwitch() for the first common supercommander
- of the current and new Targets.
-
- * AllowSwitchTarget()
- Removed this function. It's replaced by the new AllowBeTarget()
- function, which works similarly. For compatibility there is a
-
- #define AllowSwitchTarget AllowBeTarget
-
- macro. If you currently override AllowSwitchTarget(), your
- code will work the same if you rename that function to
- AllowBeTarget(). If you don't the macro will effectively
- do the renaming for you.
-
- * SwitchTarget()
- Changed to call AllowBeTarget() and AllowDontBeTarget().
- Calls ForceTargetSwitch() to do the actual target switching
-
- * ForceTargetSwitch()
- New function. Does the actual target switching. Code was
- formerly in SwitchTarget(). Separating code lets you
- call this function when you don't want to ask permission
- to perform the switch.
-
- * TakeChainOffDuty()
- Rewrote to use a do/while loop instead of recursion
-
- * ~LCommander()
- When on duty, previous code detached object from its
- SuperCommander, then set the Target to the saved
- SuperCommander. Now code re-attaches object to its
- SuperCommander afterwards. This leaves the command
- chain intact when deleting the SubCommanders, which
- fixes some bugs with objects that needed to pass
- messages up the command chain when being deleted.
-
- Made more robust the code that resets the Target if
- the object is still the Target after deleting
- all its SubCommanders. Before, code tried again
- to set the Target to the saved SuperCommander, and
- then set the SuperCommander to nil. Now code
- sets SuperCommander to nil first, sets the Target
- to the saved SuperCommander, and if the object
- is still the Target after all that, sets the
- sTarget variable explicitly to the SuperCommander.
-
-
- LControlImp
- -------------
- * SetFontStyle()
- Declared ControlFontStyleRec& parameter as const
-
- * GetFontSytle()
- Declared as const
-
- * SetKeyboardFocusPart()
- New function. Subclasses should override to set the focus
- within multipart Controls.
-
- * DoKeyPress()
- Returns control part code instead of a bool
-
-
- LControlPane
- ------------
- * PokeMinValue()
- New function which directly sets the min value without any
- side effects. Needed for cases where the Toolbox overloads
- the min value to hold an option value when creating the
- Control.
-
-
- LDragAndDrop
- ------------
- * HandleDragSendData()
- * HandleDragInput()
- * HandleDragDrawing()
- Set up and restore A5 world needed by 68K code
-
-
- LEventDispatcher
- ----------------
- * EventSuspend()
- Call LCommander::ForceSwitchTarget() instead of SwitchTarget()
-
-
- LGAColorSwatchControl
- ---------------------
- * DrawSelf()
- Restore localFrame on each pass through the draw loop.
-
-
- LGAPopupButtomImp
- -----------------
- * Removed mUseResMenu and mResType instance variables. They were left
- over from an earlier version, but are unused now.
-
- * Init()
- Remove popupMenuResID variable. It is not used in the function.
-
-
- LGroupBox
- ---------
- * DrawText()
- Call EraseRect() before drawing text to erase line which is
- underneath the text
-
-
- LKeyScrollAttachment
- --------------------
- * ExecuteSelf()
- Changed calculation of amount to scroll for page up/down
- to be consistent with that used by LScroller and
- LScrollerView
-
-
- LMenuController
- ---------------
- * SetMenuMinMax()
- Suppress drawing while setting min/max values
-
-
- LModelDirector
- --------------
- * ProcessTokenizedEvent()
- Removed re-declaration of "event" StAEDescriptor within
- for loop in the situation where it is processing token
- by token. "event" is already declared outside the loop
- and is set to a duplicate of the AppleEvent. The re-declaration
- resets the descriptor to typeNull, which is wrong.
-
-
- LPopupButton
- ------------
- * Don't change Menu ID to MENU_Unspecified. Let imps do that if
- necessary.
-
-
- LPrintout
- ---------
- * InitPrinout()
- Removed check for color QuickDraw. Always create a
- color window since PP requires color QD.
-
-
- LProgressBar
- ------------
- * SetIndeterminate()
- Added a new parameter, inStartNow, with a default value
- of true. It specifies whether to start animating immediately
- when changing to an indeterminate progress bar.
-
-
- LStdControlImp
- --------------
- * SetDescriptor()
- Use StFocusAndClipIfHidden instead of calling FocusDraw()
-
- * ActivateSelf()
- * DeactivateSelf()
- * EnableSelf()
- * DisableSelf()
- Suppress drawing. Refresh instead.
-
-
- LStdPopupMenuImp
- ----------------
- * Changed strategy for dealing with the MenuHandle. The standard
- (System 7) popup menu CDEF requires a valid MENU resource
- in order to work properly. Previously, this class used
- MENU_Unspecified for the MENU id, which was wrong. Now, it
- uses the user-specified MENU id, but calls GetMenu() before
- creating the control.
-
- To isolate the MenuHandle, the MenuHandle is only installed
- in the Toolbox MenuList for the duration of Control Manager
- calls that need the MenuHandle (Drawing, Tracking, and
- Setting the value). A new StPopupMenuInserter class handles
- inserting and removing the MenuHandle from the MenuList.
-
-
- LTableMultiRowSelector
- ----------------------
- * RemoveCols()
- * RemoveRows()
- Fixed calculation of selected cells after deleted items
-
-
- LWindow
- -------
- * CreateWindow()
- Put try/catch block around call to FinishCreate(). If it fails,
- we delete the Window (which is in an inconsistent state)
- and rethrow.
-
- * AdjustUserBounds()
- Set user bounds to current Window size and location if the
- Window is not at the standard state. This fixes a bug with
- zooming when dragging a Window that's zoomed out on one
- monitor to a different monitor.
-
- * Deactivate()
- Call ForceTargetSwitch() instead of SwitchTarget()
-
-
- PowerPlant Resorcerer TMPLs
- ---------------------------
- * Changed LClock flags field values. "isLive" (value 2) was removed,
- and replaced with "liveDisplayOnly" (value 3), because the
- live option is only valid if displayOnly is also set.
-
-
- PowerPlant.r
- ------------
- * Changed LClock flags field values. "isLive" (value 2) was removed,
- and replaced with "liveDisplayOnly" (value 3), because the
- live option is only valid if displayOnly is also set.
-
-
- PP_Macros.h
- -----------
- * New PP_Obsolete_AllowTargetSwitch symbol. If 1 (ON),
- LCommander.h uses a
-
- #define AllowTargetSwitch AllowBeTarget
-
- macro to effectively rename existing AllowTargetSwitch()
- functions to AllowBeTarget(). The default is ON, but
- we recommend that you change you code to rename all
- AllowSwitchTarget() overrides to AllowBeTarget().
-
-
- StDialogHandler
- ---------------
- * InitDialogHandler()
- Delete Undoer if AddAttachment() fails
-
-
- StValueChanger
- --------------
- * StValueChanger()
- Changed inNewValue parameter from
- T inNewValue
- to
- const T& inNewValue
-
- A const reference is more efficient if T is a class, since
- it avoids an extra call to T's copy constructor when pushing
- inNewValue on the stack. There is no extra overhead if T
- is a built-in type such as int.
-
-
- UDesktop
- --------
- * NewDeskWindow()
- Removed check for color QuickDraw. Always create a
- color window since PP requires color QD.
-
-
- UFloatingDesktop
- ----------------
- * NewDeskWindow()
- Removed check for color QuickDraw. Always create a
- color window since PP requires color QD.
-
-
- UScreenPort
- -----------
- * Initialize()
- * Dispose()
- Removed checks for color support. Always uses a color port
- since PP requires color QD.